﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SmartMeterParamFrame.Model.DIValueConverters
{
    /// <summary>
    /// di数据解析接口
    /// </summary>
    interface IDIDataConverter
    {
        /// <summary>
        /// 是否可以解析，指定的DI
        /// </summary>
        /// <param name="di"></param>
        /// <returns></returns>
        bool CanConverter(string di);

        /// <summary>
        /// 解析相应的DI值
        /// </summary>
        /// <param name="di"></param>
        /// <param name="value"></param>
        /// <returns></returns>
        string ConvertToUI(string di, string lowValue);

        /// <summary>
        /// 将数据转换成
        /// 底层保存形式
        /// </summary>
        /// <param name="di"></param>
        /// <param name="value"></param>
        /// <returns></returns>
        string ConvertToLow(string di, string uiValue);

        /// <summary>
        /// 校验一个值，是否合法
        /// </summary>
        /// <param name="di"></param>
        /// <param name="value"></param>
        /// <returns></returns>
        bool ValidateValue(string di, string value);
    }
}
